#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;

int main()
{
	set<int> s;
	int n = 0, x = 0;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		vector<int> v(s.begin(), s.end());
		for (int j = 0; j < v.size(); ++j)
		{
			s.insert(x+v[j]);
			if (abs(x - v[j]) != 0)
				s.insert(abs(x - v[j]));
		}
		s.insert(x);
	}

	cout << s.size() << endl;
	return 0;
}